/**
 * 递增运算符重载
 */
// Created by 束庆乐 on 2024/12/31.
//
#include "iostream"
using namespace std;

class MyInteger{
    friend ostream& operator<<(ostream& out,MyInteger myInt);
public:
    MyInteger(){
        this->mNum = 0;
    }
    //前置++
    MyInteger& operator++(){
        //先++后返回
        mNum++;
        return *this;
    }
    //后置++
    MyInteger& operator++(int){
        //先返回后++
        MyInteger temp = *this;
        mNum++;
        return temp;
    }
private:
    int mNum;
};
ostream& operator<<(ostream& out,MyInteger myInt){
    out << myInt.mNum;
    return out;
}
void test1(){
    MyInteger myInt;
    cout << ++myInt << endl;
    cout << myInt++ << endl;
}
void test2(){
    MyInteger myInt;
    cout << myInt++ << endl;
    cout << myInt << endl;
}
int main074(){
//    test1();
    test2();
    return 0;
}